
if __name__ == "__main__":
    try:
        # 测试本地连接
        connections.connect(
            uri=envConfig.MILVUS_LOCAL_URI,
            user=envConfig.MILVUS_USER,
            password=envConfig.MILVUS_PASSWORD
        )
        print("本地 Milvus 连接成功")

        # 如果需要测试云端连接
        # connections.connect(
        #     uri=envConfig.BACKUP_MILVUS_URI,
        #     user=envConfig.BACKUP_MILVUS_USERNAME,
        #     password=envConfig.BACKUP_MILVUS_PASSWORD,
        #     secure=True
        # )
    except Exception as e:
        print(f"连接失败: {str(e)}")

